package work20241220;

import cn.hutool.core.img.ImgUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;

import java.awt.*;
import java.io.*;

/**
 * @author zdl
 * @date 2024/12/21
 */
public class Demo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("D:/test/MIUI12.jpg");
        FileOutputStream fos = new FileOutputStream("D:/test/a/2.jpg");
        long copy = IoUtil.copy(fis, fos, IoUtil.DEFAULT_BUFFER_SIZE);
        System.out.println(copy);
        fos.close();
        fis.close();
        File file = new File("D:/test");
        File[] ls = FileUtil.ls("D:/test");
        for (File l : ls) {
            System.out.println(l.getAbsolutePath());
        }
        File touch = FileUtil.touch("D:/test/ccc/ddd/1.txt");
        System.out.println(touch);
        boolean del = FileUtil.del("D:/test/ccc/ddd");
        System.out.println(del);

        ImgUtil.pressText(
                        FileUtil.file("D:/test/MIUI12.jpg"),
                        FileUtil.file("D:/test/3.jpg"),
                        "hello",
                Color.CYAN,
                new Font("楷体",Font.BOLD,100),
                        0,0,
                        0.8f
                );

    }
}
